/**
 * TManVerifier.java
 * ************************** 
 * @date Jul 8, 2011
 * @author Michele Tamburini
 * 
 * **************************
 */
package infrastructureAPI.algorithms.instanceTools.facilities;

import gossipServices.basic.nodeDescriptors.GeneralNodeDescriptor;
import gossipServices.basic.nodeDescriptors.NodeDescriptor;
import gossipServices.bootstraping.tman.TManService;
import infrastructureAPI.Requester;
import infrastructureAPI.Service;
import infrastructureAPI.APIMessages.DispatcherRequestMessage;
import infrastructureAPI.APIMessages.RequestMessage;
import infrastructureAPI.algorithms.GeneralAPIFunctionAlgorithm;

import java.net.InetAddress;
import java.util.List;
import java.util.Vector;

/**
 * Description: 
 *
 */
public class TManVerifier extends GeneralAPIFunctionAlgorithm {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
//	protected TManVerifier(){}
	
	public TManVerifier(Requester requester){
		super(requester);
	}

	@Override
	public RequestMessage createRequestMessage(InetAddress targetAddress,
			String targetNodeName) {
		NodeDescriptor target = new GeneralNodeDescriptor(targetNodeName, targetAddress,0);
		return new DispatcherRequestMessage(target, this, requester);
//		return defaultRequestMessageComposition(targetAddress, targetNodeName);
	}

	@Override
	public Service extractServiceToDeRegister() {
		return null;
	}

	@Override
	public Service extractSuppliedService() {
		return null;
	}

	@Override
	public boolean requireReply() {
		return true;
	}

	@Override
	public boolean requireSystemDeRegistration() {
		return false;
	}

	@Override
	public boolean requireSystemRegistration() {
		return false;
	}

	@Override
	public List<Class<?>> requiredServices() {
		List<Class<?>> reqServices = new Vector<Class<?>>();
		reqServices.add(TManService.class);
		return reqServices;
	}

	@Override
	public void run() {
		returnValue = true;
		/* do nothing */
	}

}
